package com.naton.mydemo.ui.act;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.naton.common.bean.ImageItem;
import com.naton.common.callback.OnSingleClickListener;
import com.naton.common.ui.BaseActivity;
import com.naton.common.utils.picture.PicSelectorListener;
import com.naton.common.utils.picture.PictureSelectorUtils;
import com.naton.mydemo.databinding.ActivityPictureSelectorBinding;

import java.util.List;

/**
 * @time: 2022/1/19
 * @author: lifuling
 * @version: v1.0
 * @file_desc:
 */
public class PictureSelectorActivity extends BaseActivity<ActivityPictureSelectorBinding> {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        addListener();
    }

    private void initView() {
    }

    private void addListener() {
        //单独拍照
        mBinding.tv2.setOnClickListener(new OnSingleClickListener() {
            @Override
            public void onSingleClick(View view) {
                PictureSelectorUtils.showPicSelect(PictureSelectorActivity.this, null, 5, new PicSelectorListener() {
                    @Override
                    public void onResult(List<ImageItem> result) {

                    }

                    @Override
                    public void onCancel() {

                    }
                });

            }
        });

        //获取图片
        mBinding.tv1.setOnClickListener(new OnSingleClickListener() {
            @Override
            public void onSingleClick(View view) {
                PictureSelectorUtils.showPicSelect(PictureSelectorActivity.this, null, 5, new PicSelectorListener() {
                    @Override
                    public void onResult(List<ImageItem> result) {

                    }

                    @Override
                    public void onCancel() {

                    }
                });

            }
        });
    }
}
